package com.reggie.mapper;

import com.reggie.pojo.DishFlavor;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishFlavorMapper {
    @Insert("INSERT INTO dish_flavor(id, dish_id, name, value, create_time, update_time, create_user, update_user, is_deleted) " +
            "values(#{id}, #{dishId}, #{name}, #{value}, now(), now(), #{createUser}, #{updateUser}, 0)")
    int add(DishFlavor dishFlavor);

    @Select("SELECT * from dish_flavor WHERE dish_id=#{dishId} and is_deleted=#{isDeleted}")
    List<DishFlavor> findByDishId(Long dishId, Integer isDeleted);
}
